package com.to8to.kitt.utils;

import java.net.InetSocketAddress;
import java.net.SocketAddress;

public class AddressUtil {
	public static SocketAddress getSocketAddress(String addr)
	{
		if(addr == null || addr.trim().length() == 0)
			return null;
		String[] arr = addr.split(":");
		if(arr != null && arr.length == 2)
		{
			String ip = arr[0];
			int port = Integer.valueOf(arr[1]);
			return new InetSocketAddress(ip, port);
		}
		return null;
	}
}
